home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol029 / printest.bas < prev    next >
Encoding:
BASIC Source File  |  1987-01-11  |  2.9 KB  |  71 lines

  1. 1   'PC MAGAZINE PRINTER TEST PROGRAM
  2. 10  ON ERROR GOTO 690
  3. 20  CLS
  4. 30  PRINT "PRINTER SPEED BENCHMARK TEST"
  5. 40  PRINT:PRINT
  6. 50  PRINT "This program is designed to test the speed of any printer."
  7. 60  PRINT "It will print 50 lines of text."
  8. 70  PRINT
  9. 80  PRINT "Each line will be indented five spaces and have 65 characters."
  10. 90  PRINT
  11. 100 PRINT "At the end of this test, the number of lines, the elapsed time,"
  12. 110 PRINT "and the throughput in characters per second and lines per minute"
  13. 120 PRINT "will be printed at the bottom of the page and on the screen."
  14. 150 PRINT
  15. 180 PRINT:INPUT "Specify printer make and model";ZZ$
  16. 190 IF ZZ$="" THEN ZZ$="PRINTER NOT SPECIFIED"
  17. 200 GOSUB 520
  18. 210 PRINT:INPUT"Insert paper in printer and press ENTER";QQ$
  19. 220 W$="     This is a Test Line. It has a total of 65 characters. ZYXW{[]}%*&"
  20. 230 LW=LEN(W$): 'tests length of line
  21. 240 L=50
  22. 250 PRINT #1,
  23. 260 PRINT #1,"Printer Speed Benchmark Test: ";ZZ$: PRINT #1,
  24. 270 TIME$="0"
  25. 280 FOR I=1 TO L
  26. 290 PRINT #1, W$
  27. 300 NEXT I
  28. 310 T$=TIME$
  29. 320 M$=MID$(T$, 4,2)   'defines minutes
  30. 330 S$= RIGHT$(T$,2)   'defines seconds
  31. 340 LET M=VAL(M$) : REM minutes
  32. 350 LET S=VAL(S$) : REM seconds
  33. 360 TT=(M*60)+S:       'total time in seconds
  34. 370 NC=L*LW:           'total number of characters
  35. 380 TM=M+(S/60)        'total minutes
  36. 390 TP=NC/TT:          'throughput
  37. 400 PRINT #1,
  38. 420 GOTO 450
  39. 430 SCRN=1
  40. 440 CLS
  41. 450 PRINT #1,
  42. 460 IF ZZ$<>"" THEN ZZ2$="Throughput report for "
  43. 465 PRINT #1,"Elapsed time = ";M;"minute(s) and";S;"seconds(s) for";                   L;"lines of text."
  44. 470 PRINT #1, ZZ2$;ZZ$":"
  45. 480 PRINT #1,TP;"characters per second for";NC;"characters."L/TM"lines per minute."
  46. 500 CLOSE #1 :OPEN "SCRN:" FOR OUTPUT AS #1:IF SCRN=1 THEN SYSTEM ELSE GOTO 430
  47. 510 REM
  48. 520 CLS
  49. 530 PRINT " ////// OUTPUT SELECTION MENU //////"
  50. 540 PRINT:PRINT
  51. 550 PRINT "1. First parallel printer  (LPT1:)"
  52. 560 PRINT "2. Second parallel printer (LPT2:)"
  53. 570 PRINT "3. Third parallel printer  (LPT3:)"
  54. 580 PRINT "4. First serial printer    (COM1:)"
  55. 590 PRINT "5. Second serial printer   (COM2:)"
  56. 591 PRINT "6. The system console      (CON:)"
  57. 600 PRINT:PRINT
  58. 610 PRINT "ENTER THE APPROPRIATE NUMBER:";:O$=INPUT$(1):LOCATE,,1:PRINT O$
  59. 620 IF VAL(O$)=1 THEN OPEN "LPT1:" FOR OUTPUT AS #1:RETURN
  60. 630 IF VAL(O$)=2 THEN OPEN "LPT2:" FOR OUTPUT AS #1:RETURN
  61. 640 IF VAL(O$)=3 THEN OPEN "LPT3:" FOR OUTPUT AS #1:RETURN
  62. 650 IF VAL(O$)=4 THEN OPEN "COM1:" FOR OUTPUT AS #1:RETURN
  63. 660 IF VAL(O$)=5 THEN OPEN "COM2:" FOR OUTPUT AS #1:RETURN
  64. 670 IF VAL(O$)=6 THEN OPEN "SCRN:" FOR OUTPUT AS #1:RETURN
  65. 680 BEEP:GOTO 610
  66. 690 BEEP:PRINT "ERROR - You probably selected an incorrect device."
  67. 700 IF ERR=68 THEN BEEP:PRINT:PRINT "Device unavailable, please try again.":           RESUME 610
  68. 710 ON ERROR GOTO 0
  69. 720 ' THIS IS THE LAST LINE OF THE PROGRAM.
  70. evice unavailable, please try again.":           RESUME 610
  71. 710 ON ERROR GOTO